<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <link rel="icon" type="image/x-icon" th:href="${application.iconPath}"/>
    <title>系统选择</title>
    <div th:include="../templates/common::html_header"></div>
    <style>
        ul {
            width: 90%;
            margin-top: 50px;
            margin-left: 20px;
            height: auto;
            float: left;
        }

        ul li {
            width: 150px;
            height: 150px;
            margin-top: 30px;
            margin-left: 50px;
            float: left;
        }

        ul li .s_top {
            width: 100px;
            height: 100px;
            margin-top: 10px;
            margin-left: 25px;
        }

        .s_top img {
            width: 100px;
            height: 100px;
        }

        ul li .s_bottom {
            margin-top: 10px;
            text-align: center;
        }
    </style>
</head>

<body>
<div class="layui-form contain ">
    <ul id="view">
        <li>文档管理系统</li>
        <li>权限管理系统</li>

        <li>22</li>
    </ul>
</div>
</body>
<script type="text/html" id="system_tpl">
    {{#  layui.each(d.result, function(index, item){ }}
    <li>
        <div class="s_top">
            <a href="{{ item.url }}" target="_blank">
                <img src="{{ item.icon  }}"/>
            </a>
        </div>
        <div class="s_bottom">
            <a href="{{ item.url }}" target="_blank">{{ item.code }}{{ item.name }}</a>
        </div>
    </li>
    {{#  }); }}
    {{#  if(d.result.length === 0){ }}
    <里>
        无数据
    </里>
    {{#  } }}
</script>
</html>
<div th:include="../templates/common::html_footer"></div>
<script>
    layui.use(['layer', 'laytpl', 'web'], function () {
        var layer = layui.layer;
        var laytpl = layui.laytpl;
        var web = layui.web;

        var url = basePath + "/index/system";
        web.ajax(url, 'post', {}, function (data) {
            var getTpl = system_tpl.innerHTML
                , view = document.getElementById('view');
            laytpl(getTpl).render(data, function (html) {
                view.innerHTML = html;
            });
        });
        $(document).on("click", ".cc", function () {
            var url = $(this).attr("name");
            console.log(url);
        });
    });
</script>
